<%@ page import="com.oval.util.JspHelper" %>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.foundation.*" %>

<%
  Category cat = Category.getInstance("jsp.login"); 
  String Ip = request.getRemoteAddr(); 
  cat.info("The Login IP is :" + Ip); 
%>
<html>
<head>
<title>E-Manager寰通电子经理管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<script>
function changePWS()
{
	var psw;
	psw = prompt("Input the password!","");  
	cform.psw.value = psw;
	cform.submit();
}


<%
  boolean rightPWS=false;
  boolean enteredPWS=false;
  
  if(session.getAttribute("ecp_psw")==null)
  {
    String psw = (String)request.getParameter("psw");
    if(psw == null)
    {
		   rightPWS=false;
		   enteredPWS=false;
	  }
	  else
	  {
		  if(!psw.equals(DefaultParams.findParam("cps")==null?"ecp":DefaultParams.findParam("cps")))
		  {
			  rightPWS=false;
			  enteredPWS=true;
		  }
		  else
		  {
			  session.setAttribute("ecp_psw",psw);
			  rightPWS=true;
			  enteredPWS=true;
		  }
	  } 
  }
  else
  {
	  String psw=(String)session.getAttribute("ecp_psw");
	  if(!psw.equals(DefaultParams.findParam("cps")==null?"ecp":DefaultParams.findParam("cps")))
	  {
		  rightPWS=true;
		  enteredPWS=true;
		}
  }

%>
</script>
<%if(rightPWS){%>
<frameset rows="50,*" cols="*" frameborder="NO" border="0" framespacing="0"> 
  <frame name="console_top" scrolling="NO" noresize src="consoleTop.jsp" >
  <frameset cols="130,*" frameborder="NO" border="0" framespacing="0" rows="*"> 
    <frame name="console_left" noresize scrolling="NO" src="consoleLeft.jsp">
    <frame name="console_content" src="../" scrolling="YES">
  </frameset>
</frameset>
<%}%>
<body bgcolor="#FFFFFF" text="#000000">
<form name="cform" method="post" action="main.jsp">
  <input type="hidden" name="psw" value="<%=JspHelper.filterNull( request.getParameter("psw"))%>"> 
</form>
</body>
<%if(!rightPWS&&enteredPWS){%>
<script>
self.location="http:\\www.google.com";
</script>
<%}%>
<%if(!rightPWS&&!enteredPWS){%>
<script>
changePWS();
</script>
<%}%>
</html>

